package com.example.androidmaze;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class FinishActivity extends Activity {

	private static final String TAG = "FinishActivity";
	String strSuccess;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Bundle extras = getIntent().getExtras();
		if (extras != null) {
			strSuccess = extras.getString("Success");
		    Log.v(TAG, "Extras unpackaged");
		    Log.v(TAG, "strSuccess: " + strSuccess);
		}
		
		setContentView(R.layout.activity_finish);
		
		Button btnStart = (Button)findViewById(R.id.button1);
		TextView txtSuccess = (TextView)findViewById(R.id.Success);
		txtSuccess.setText(strSuccess);
		
		btnStart.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				 
				toTitle(v);
			}
		});
	}
	
	public void toTitle( View view) {
		Intent intent = new Intent(this, TitleActivity.class);
		startActivity(intent);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.finish, menu);
		return true;
	}

}
